package com.xiaoyu.client.network;

import android.text.TextUtils;
import android.widget.TextView;

import com.xiaoyu.client.ClientConstants;
import com.xiaoyu.commonlib.BillionCardConstants;
import com.xiaoyu.commonlib.network.BaseNetworkManager;
import com.xiaoyu.commonlib.network.CommonHttpResponser;
import com.xiaoyu.commonlib.utils.PreferencesUtil;

import java.io.PipedOutputStream;
import java.lang.reflect.Array;
import java.security.PublicKey;
import java.util.HashMap;
import java.util.List;

/**
 * Created by jk on 2018/9/27.
 */
public class NetworkManager {

    /**
     * 注册接口
     *
     * @param usertel  手机号
     * @param verify   验证码
     * @param pas      密码
     * @param listener
     */
    public static void registerUser(String usertel, String verify, String pas, CommonHttpResponser listener) {
        HashMap<String, String> params = new HashMap<>();
        params.put("usertel", usertel);
        params.put("verify", verify);
        params.put("pas", pas);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.REGISTER_URL, params, listener);
    }


    /**
     * 发送验证码接口
     *
     * @param usertel  手机号码
     * @param listener
     */
    public static void sendVerify(String usertel, CommonHttpResponser listener) {
        HashMap<String, String> params = new HashMap<>();
        params.put("usertel", usertel);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEND_VERIFY_URL, params, listener);
    }

    /**
     * 重新设置密码
     *
     * @param usertel  手机号
     * @param verify   验证码
     * @param pas      密码
     * @param listener
     */
    public static void modificationPwd(String usertel, String verify, String pas, CommonHttpResponser listener) {
        HashMap<String, String> params = new HashMap<>();
        params.put("usertel", usertel);
        params.put("verify", verify);
        params.put("pas", pas);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MODIFICATION_PWD_URL, params, listener);
    }


    /**
     * 登录接口
     *
     * @param usertel  手机号
     * @param pas      密码
     * @param listener
     */
    public static void login(String usertel, String pas, CommonHttpResponser listener) {
        HashMap<String, String> params = new HashMap<>();
        params.put("usertel", usertel);
        params.put("pas", pas);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.LOGIN_URL, params, listener);
    }


    /**
     * 微信登录
     *
     * @param openid     openid
     * @param headimgurl 头像
     * @param sex        性别
     * @param nickname   姓名
     * @param listener
     */
    public static void weChatLogin(String openid, String headimgurl, String sex, String nickname, CommonHttpResponser listener) {
        HashMap<String, String> params = new HashMap<>();
        params.put("openid", openid);
        params.put("headimgurl", headimgurl);
        params.put("sex", sex);
        params.put("nickname", nickname);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.WECHAT_LOGIN, params, listener);
    }

    //https://api.weixin.qq.com/sns/oauth2/access_token?appid=APPID&secret=SECRET&code=CODE&grant_type=authorization_code

    /**
     * 通过code获取token与openid
     *
     * @param secret
     * @param code
     * @param grant_type
     * @param listener
     */
    public static void getAccessToken(String appid, String secret, String code, String grant_type, CommonHttpResponser listener) {
        HashMap<String, String> params = new HashMap<>();
        params.put("appid", appid);
        params.put("secret", secret);
        params.put("code", code);
        params.put("grant_type", grant_type);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.GET,
                "https://api.weixin.qq.com/sns/oauth2/access_token?", params, listener);
    }

    //https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=APPID&grant_type=refresh_token&refresh_token=REFRESH_TOKEN

    /**
     * 刷新token
     *
     * @param grant_type
     * @param refresh_token
     * @param listener
     */
    public static void getRefreshToken(String grant_type, String refresh_token, CommonHttpResponser listener) {
        HashMap<String, String> params = new HashMap<>();
        params.put("grant_type", grant_type);
        params.put("refresh_token", refresh_token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.GET,
                "https://api.weixin.qq.com/sns/oauth2/refresh_token?appid=" + ClientConstants.APP_ID_WECHAT, params, listener);
    }

    //https://api.weixin.qq.com/sns/userinfo?access_token=ACCESS_TOKEN&openid=OPENID

    /**
     * 通过token获取个人信息
     *
     * @param access_token
     * @param openid
     * @param listener
     */
    public static void getWeChatInfo(String access_token, String openid, CommonHttpResponser listener) {
        HashMap<String, String> params = new HashMap<>();
        params.put("access_token", access_token);
        params.put("openid", openid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.GET,
                "https://api.weixin.qq.com/sns/userinfo?", params, listener);
    }

//-----------------------------------------首页-------------------------------------------------------

    /**
     * 首页信息
     *
     * @param lat      经度
     * @param lng      纬度
     * @param listener
     */
    public static void getHomeInfo(String lat, String lng, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("lat", lat);
        param.put("lng", lng);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.HOME_INFO_URL, param, listener);
    }

    /**
     * 附近商家列表的展示  --  所有
     *
     * @param page     当前页数
     * @param lat      经度
     * @param lng      纬度
     * @param listener
     */
    public static void getNearbyShopAllList(int page, String lat, String lng, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("lat", lat);
        param.put("lng", lng);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.NEARBY_STORE_LIST_URL, param, listener);
    }

    /**
     * 附近商家列表的展示 -- 搜索
     *
     * @param page     当前页数
     * @param keywords 查询的关键字
     * @param lat      经度
     * @param lng      纬度
     * @param listener
     */
    public static void getNearbyShopBySearchList(int page, String keywords, String lat, String lng, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("keywords", keywords);
        param.put("lat", lat);
        param.put("lng", lng);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.NEARBY_STORE_LIST_URL, param, listener);
    }

    /**
     * 附近商家列表的展示  --  按类别
     *
     * @param page     当前页数
     * @param tag_id   店铺所属类别的ID
     * @param lat      经度
     * @param lng      纬度
     * @param listener
     */
    public static void getNearbyShopByTypeList(int page, String tag_id, String lat, String lng, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("tag_id", tag_id);
        param.put("lat", lat);
        param.put("lng", lng);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.NEARBY_STORE_LIST_URL, param, listener);
    }

    /**
     * 获取附近商铺类别列表
     *
     * @param listener
     */
    public static void getShopTagList(CommonHttpResponser listener) {
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.NEARBY_STORE_TAG_LIST_URL, null, listener);
    }

    /**
     * 获取商铺详情
     *
     * @param storeid  商铺id
     * @param listener
     */
    public static void getShopDetailInfo(String storeid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("storeid", storeid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.NEARBY_SHOP_DETAIL_URL, param, listener);
    }

    /**
     * 首页 -- 附近商店 -- 我的推荐
     *
     * @param page
     * @param token
     * @param state    审核状态1待审核，2审核通过，0未通过
     * @param lat      经度
     * @param lng      纬度
     * @param listener
     */
    public static void getMyRecommend(int page, String token, int state, String lat, String lng, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("token", token);
        param.put("state", String.valueOf(state));
        param.put("lat", lat);
        param.put("lng", lng);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.NEARBY_SHOP_MY_RECOMMEND, param, listener);
    }

    /**
     * 推荐入住
     *
     * @param store_name       店铺名称
     * @param store_image      店铺图片的地址
     * @param store_tag        店铺所属的类别id 用英文逗号隔开 最多三个
     * @param store_address    店铺的详细地址
     * @param store_city       店铺所在的城市
     * @param store_owner_name 店主的名字
     * @param store_owner_tel  店主的手机号
     * @param store_owner_tel2 店主的备用手机号
     * @param listener
     */
    public static void sendAddRecommendShop(String store_name, String store_image, String store_tag, String store_address,
                                            String store_city, String store_owner_name, String store_owner_tel, String store_owner_tel2, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("store_name", store_name);
        param.put("store_image", store_image);
        param.put("store_tag", store_tag);
        param.put("store_address", store_address);
        param.put("store_city", store_city);
        param.put("store_owner_name", store_owner_name);
        param.put("store_owner_tel", store_owner_tel);
        param.put("store_owner_tel2", store_owner_tel2);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.NEARBY_SHOP_RECOMMEND_ADD_URL, param, listener);
    }


    /**
     * 添加推荐入住商铺时选择的商铺类型表
     *
     * @param listener
     */
    public static void getShopTypeForAddList(CommonHttpResponser listener) {
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SHOP_TYPE_URL, null, listener);
    }

//----------------------------------------商城--------------------------------------------------------

    /**
     * 商城首页（轮播图、类型、推荐）
     *
     * @param listener
     */
    public static void getMallRecom(CommonHttpResponser listener) {
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MALL_HOME_RECOM_URL, null, listener);
    }


    /**
     * 商城首页（更多产品）
     *
     * @param page
     * @param listener
     */
    public static void getMallMoreProduct(int page, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MALL_HOME_MORE_URL, param, listener);
    }


    /**
     * 更多类型页面 -- 类型列表
     *
     * @param listener
     */
    public static void getGoodsTagList(CommonHttpResponser listener) {
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MORE_GOODS_TAG_LIST_URL, null, listener);
    }


    /**
     * 获取商品列表 -- 通过关键字
     *
     * @param page
     * @param keywords 关键字
     * @param listener
     */
    public static void getGoodsByKeyList(int page, String keywords, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("keywords", keywords);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_LIST_FOR_TAG_URL, param, listener);
    }


    /**
     * 配件升级、限时购买的商品列表
     *
     * @param page
     * @param sell     配件升级传p，限时购买传x
     * @param listener
     */
    public static void getGoodsUpdateList(int page, String sell, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("sell", sell);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_LIST_FOR_TAG_URL, param, listener);
    }

    /**
     * 获取商品列表 -- 通过商品类型
     *
     * @param page
     * @param goodstagid 商品类型id
     * @param listener
     */
    public static void getGoodsByTagList(int page, String goodstagid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("goodstagid", goodstagid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_LIST_FOR_TAG_URL, param, listener);
    }

    /**
     * 获取商品列表 -- 通过商品类型和商家
     *
     * @param page
     * @param goodstagid    商品类型id
     * @param goodsstroreid 商家id
     * @param listener
     */
    public static void getGoodsByStoreList(int page, String goodstagid, String goodsstroreid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("goodstagid", goodstagid);
        param.put("goodsstroreid", goodsstroreid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_LIST_FOR_TAG_URL, param, listener);
    }


    /**
     * 获取商品信息
     *
     * @param goodsid  商品id
     * @param listener
     */
    public static void getGoodsDetailInfo(String goodsid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("goodsid", goodsid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_DETAIL_URL, param, listener);
    }

    /**
     * 获取商品的评价
     *
     * @param page
     * @param goodsid  商品id
     * @param listener
     */
    public static void getGoodsCommentList(int page, String goodsid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("goodsid", goodsid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_COMMENTS_URL, param, listener);
    }

    /**
     * 获取商品规格信息
     *
     * @param goodsid
     * @param listener
     */
    public static void getGoodsFormatInfo(String goodsid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("goodsid", goodsid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_DETAIL_SPECIFICATION_URL, param, listener);
    }


    /**
     * 获取商家的评价
     *
     * @param page
     * @param goodsstroreid 商家id
     * @param listener
     */
    public static void getStoreCommentList(int page, String goodsstroreid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("goodsstroreid", goodsstroreid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_COMMENTS_URL, param, listener);
    }

    /**
     * 获取商家详情
     *
     * @param goodsstroreid 商家id
     * @param listener
     */
    public static void getStoreDetailInfo(String goodsstroreid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("goodsstroreid", goodsstroreid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.STORE_DETAIL_URL, param, listener);
    }

    /**
     * 商品收藏
     *
     * @param goodsid  商品id
     * @param listener
     */
    public static void getGoodsCollect(String goodsid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("goodsid", goodsid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.GOODS_COLLECT, param, listener);
    }


    /**
     * 商城 -- 订单详情
     *
     * @param goodsnumber    商品数量
     * @param goodsdetailsid 商品规格id
     * @param usercouponsid  优惠券
     * @param listener
     */
    public static void getConfirmOrder(String token, String goodsnumber, String goodsdetailsid, String usercouponsid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("goodsnumber", goodsnumber);
        param.put("goodsdetailsid", goodsdetailsid);
        param.put("usercouponsid", usercouponsid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.CONFIRM_ORDER, param, listener);
    }


    /**
     * 提交订单
     *
     * @param paytype        支付方式  wallet:余额  wx:微信  ali:支付宝
     * @param goodsdetailsid 商品规格id
     * @param goodsnumber    商品数量
     * @param usercouponsid  优惠卷id
     * @param addressid      用户地址id
     * @param listener
     */
    public static void toCommitOrder(String paytype, String goodsdetailsid, String goodsnumber,
                                     String usercouponsid, String addressid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("paytype", paytype);
        param.put("goodsdetailsid", goodsdetailsid);
        param.put("goodsnumber", goodsnumber);
        param.put("usercouponsid", usercouponsid);
        param.put("addressid", addressid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.ORDER_COMMIT, param, listener);
    }


    /**
     * 未支付的订单的支付接口
     *
     * @param orderid  订单id
     * @param paytype  支付方式  wallet:余额  wx:微信  ali:支付宝
     * @param listener
     */
    public static void toCommitUnpayOrder(String orderid, String paytype, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("orderid", orderid);
        param.put("paytype", paytype);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.ORDER_UNPAY_TO_PAY, param, listener);
    }


    /**
     * 我的订单 - 待发货 - 订单详情
     *
     * @param orderid  订单id
     * @param listener
     */
    public static void orderDetails(String orderid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("orderid", orderid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.ORDER_DETAILS, param, listener);

    }

    /**
     * 我的会员 -- 会员Vip
     *
     * @param token
     * @param listener
     */
    public static void memberVip(String token, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MEMBER_VIP, param, listener);
    }

    /**
     * 我的会员 -- 会员vip -- 充值
     *
     * @param token
     * @param viptypeid
     * @param paytype
     * @param listener
     */
    public static void vipTopup(String token, String viptypeid, String paytype, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("viptypeid", viptypeid);
        param.put("paytype", paytype);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.VIP_TOPUP, param, listener);
    }

    /**
     * 我的钱包 -- 余额充值
     *
     * @param token
     * @param money    最小充值10元
     * @param paytype
     * @param listener
     */
    public static void balanceTopup(String token, String money, String paytype, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("money", money);
        param.put("paytype", paytype);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.BALANCE_TOPUP, param, listener);
    }

//----------------------------------------求助--------------------------------------------------------

    /**
     * 求助类别
     *
     * @param listener
     */
    public static void getSeekType(CommonHttpResponser listener) {
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_TYPE_URL, null, listener);
    }


    /**
     * 添加求助
     *
     * @param seektitle   求助的标题50字的那个
     * @param seekcontent 求助的详细描述
     * @param seekimg     图片路径，有就传，没有传"", 如果是多张图片请用逗号将路径拼接。
     * @param seephelpid  求助的类别id（单选,传id）
     * @param seekress    定位的地址（文字）
     * @param listener
     */
    public static void addSeek(String seektitle, String seekcontent, String seekimg, int seephelpid, String seekress, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("seektitle", seektitle);
        param.put("seekcontent", seekcontent);
        param.put("seekimg", seekimg);
        param.put("seephelpid", seephelpid + "");
        param.put("seekress", seekress);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_ADD_URL, param, listener);

    }


    /**
     * 求助列表
     *
     * @param page       页数：从1开始
     * @param seekstate  状态: 0:未解决,1:已解决，’-1’:全部
     * @param seephelpid 类别，如果是多个选多个，请用逗号拼接（如：1,2,3），不选就什么也不传
     * @param hasType    true:选择了求助类别  false：没有选择求助类别
     * @param listener
     */
    public static void getSeekList(int page, int seekstate, String seephelpid, boolean hasType, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("seekstate", String.valueOf(seekstate));
        if (hasType) {
            param.put("seephelpid", seephelpid);
        }
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_LIST_URL, param, listener);
    }

    /**
     * 求助列表
     *
     * @param page       页数：从1开始
     * @param seekstate  （不必填）  状态: 0:未解决,1:已解决，’-1’:全部
     * @param seephelpid （不必填）  类别，如果是多个选多个，请用逗号拼接（如：1,2,3），不选就什么也不传
     */
    public static void getSeekList(int page, int seekstate, String seephelpid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("seekstate", String.valueOf(seekstate));
        param.put("seephelpid", seephelpid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_LIST_URL, param, listener);
    }

    /**
     * 求助详情接口
     *
     * @param page     页数(从 page = 1 开始)
     * @param "token   用户唯一标识
     * @param seekid   求助id
     * @param listener
     */
    public static void getSeekDetail(int page, String seekid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("token", token);
        param.put("seekid", seekid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.GET,
                NetworkConstants.SEEK_DETAIL_URL, param, listener);
    }


    /**
     * 求助一级回复的回复
     *
     * @param seekid             当前回复的求助id
     * @param seekreplayparentid 一级回复的id
     * @param seekreplycontent   回复的内容
     */
    public static void sendSeekReply(String seekid, String seekreplayparentid, String seekreplycontent, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("seekid", seekid);
        param.put("seekreplayparentid", seekreplayparentid);
        param.put("seekreplycontent", seekreplycontent);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_REPLY_URL, param, listener);
    }


    /**
     * 求助的回复
     *
     * @param seekid             求助id
     * @param seekreplayparentid 父级回复的id
     * @param seekreplycontent   回复的内容
     * @param listener
     */
    public static void replySeek(String seekid, String seekreplayparentid, String seekreplycontent, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("seekid", seekid);
        param.put("seekreplayparentid", seekreplayparentid);
        param.put("seekreplycontent", seekreplycontent);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_REPLY_URL, param, listener);
    }

    /**
     * 求助收藏和取消收藏
     *
     * @param seekid
     * @param listener
     */
    public static void collectOrCancleSeek(String seekid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("seekid", seekid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_COLLECT_OR_CANCLE_URL, param, listener);
    }


    /**
     * 求助回复点赞
     *
     * @param seekreplyid
     * @param listener
     */
    public static void likeSeek(String seekreplyid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("seekreplyid", seekreplyid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.GET,
                NetworkConstants.SEEK_PRAISE_URL, param, listener);
    }


    /**
     * 追加求助问题
     *
     * @param seekid
     * @param seekcontent
     * @param listener
     */
    public static void appendSeekQuestion(String seekid, String seekcontent, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("seekid", seekid);
        param.put("seekcontent", seekcontent);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_APPEND_URL, param, listener);
    }

    /**
     * 求助完成列表（被感谢人的列表）
     *
     * @param seekid
     * @param listener
     */
    public static void getThankedPersonList(String seekid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("seekid", seekid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_OVER_THANKED_PERSON_LIST_URL, param, listener);
    }

    /**
     * 求助完成接口
     *
     * @param userid     thankuserid:感谢的所有的人的id，用逗号拼接的字符串
     * @param thanktitle 感谢的文字 （默认是‘感谢各位亿友！’，自己解决和未解决就不用传这个和上面的连个参数了）
     * @param seekid     求助id
     * @param seekstate  完成方式（看帖解决1，自己解决2，未解决0）
     * @param listener
     */
    public static void overSeek(List<String> userid, String thanktitle, String seekid, int seekstate, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("seekid", seekid);
        param.put("seekstate", String.valueOf(seekstate));
        if (seekstate == 1) {
            String thankuserid = "";
            if (userid.size() != 0) {
                StringBuilder builder = new StringBuilder();
                for (int i = 0; i < userid.size(); i++) {
                    builder.append(userid.get(i));
                    builder.append(i == userid.size() - 1 ? "" : ",");
                }
                thankuserid = builder.toString();
            }
            param.put("thankuserid", thankuserid);
            if (TextUtils.isEmpty(thanktitle)) {
                thanktitle = "感谢各位亿友！";
            }
            param.put("thanktitle", thanktitle);
        }

        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEEK_OVER_URL, param, listener);
    }

    /**
     * 求助  --  我的求助  -- 我发起的、我参与的、我收藏的
     *
     * @param seekstate
     * @param page
     * @param listener
     */
    public static void myInitiate(int state, int seekstate, int page, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        String url = "";
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        if (state == 0) {
            url = NetworkConstants.SEEK_MY_INITIATE;
            param.put("seekstate", seekstate + "");
            param.put("page", page + "");
        }
        if (state == 1) {
            url = NetworkConstants.SEEK_MY_PARTICIPATION;
        }
        if (state == 2) {
            url = NetworkConstants.SEEK_MY_COLLECTION;
            param.put("page", page + "");
        }

        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                url, param, listener);

    }

    //-------------------------------------------我的------------------------------------------------

    /**
     * 我的个人信息
     *
     * @param listener
     */
    public static void getPersonalInfo(CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.PERSONAL_INFO_URL, param, listener);
    }

    /**
     * 我的 -- 个人信息显示
     *
     * @param listener
     */
    public static void getMineInfo(CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_INFO_URL, param, listener);
    }

    /**
     * 修改个人信息
     *
     * @param nickname      昵称
     * @param individuation 个性签名
     * @param dateofbirth   出生年月
     * @param userphoto     头像
     * @param sex           性别
     * @param listener
     */
    public static void modificationInfo(String nickname, String individuation, String dateofbirth, String userphoto, String sex, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("nickname", nickname);
        param.put("individuation", individuation);
        param.put("dateofbirth", dateofbirth);
        param.put("userphoto", userphoto);
        param.put("sex", sex);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_MODIFICATION_URL, param, listener);
    }

    /**
     * 我的 - 我的钱包
     *
     * @param listener
     */
    public static void getMyWallet(CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MY_WALLET, param, listener);
    }

    /**
     * 我的 - 我的钱包 - 明细列表
     */
    public static void getParticularsList(CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
//        param.put("page",page+"");
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.WALLET_PARTICULARS_URL, param, listener);
    }

    /**
     * 我的 - 我的钱包 -- 明细 -- 账单详情
     *
     * @param walletid
     * @param listener
     */
    public static void getBillDetails(String walletid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("walletid", walletid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.BILL_DETAILS, param, listener);

    }

    /**
     * 我的 -- 个人 -- 地址
     *
     * @param listener
     */
    public static void getPersonalAddress(CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_ADDRESS_URL, param, listener);
    }

    /**
     * 我的 -- 个人 -- 添加地址
     *
     * @param provinces 省份
     * @param city      市区
     * @param county    区县
     * @param detail    详情
     * @param receiver  收件人
     * @param tel       收件人手机号
     * @param listener
     */
    public static void addAddress(String provinces, String city, String county, String detail, String receiver, String tel, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("provinces", provinces);
        param.put("city", city);
        param.put("county", county);
        param.put("detail", detail);
        param.put("receiver", receiver);
        param.put("tel", tel);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_ADD_ADDRESS_URL, param, listener);
    }

    /**
     * 我的 -- 个人信息 -- 编辑地址
     *
     * @param addressid 地址id
     * @param listener
     */
    public static void confirmAddress(String addressid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("addressid", addressid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_ADDRESS_COMPILE, param, listener);
    }

    /**
     * 我的 -- 个人信息 -- 编辑完地址上传
     *
     * @param provinces 省
     * @param city      市
     * @param county    区
     * @param detail    详情地址
     * @param receiver  收件人
     * @param tel       手机号
     * @param addressid 地址id
     * @param listener
     */
    public static void confirmFinishAddress(String provinces, String city, String county, String detail, String receiver, String tel, String addressid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("provinces", provinces);
        param.put("city", city);
        param.put("county", county);
        param.put("detail", detail);
        param.put("receiver", receiver);
        param.put("tel", tel);
        param.put("addressid", addressid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_ADDRESS_COMPILE_FINISH, param, listener);
    }

    /**
     * 我的  -- 个人信息 -- 删除地址
     *
     * @param addressid 地址id
     * @param listener
     */
    public static void deleteAddress(String addressid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("addressid", addressid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_DELETE_ADDRESS, param, listener);
    }

    /**
     * 我的 -- 个人信息 -- 选择地址
     *
     * @param addressid
     * @param listener
     */
    public static void selectedAddress(String addressid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("addressid", addressid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_SELECT_ADDRESS, param, listener);
    }

    /**
     * 我的 - 关注、粉丝
     *
     * @param type
     * @param token
     * @param page
     * @param people
     * @param listener
     */
    public static void attention(String type, String token, String page, String people, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("type", type);
        param.put("token", token);
        param.put("page", page);
        param.put("people", people);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_CONCERNED, param, listener);
    }

    /**
     * 我的 -- 签到（周一到周日是否签到）
     *
     * @param listener
     */
    public static void signIn(CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MINE_SIGN, param, listener);
    }

    /**
     * 我的 -- 签到列表 -- 添加签到
     *
     * @param listener
     */
    public static void addSign(CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.Add_SIGN, param, listener);
    }

    /**
     * 我的 -- 签到 -- 积分列表
     *
     * @param listener
     */
    public static void integralList(int page, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("page", page + "");
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SIGN_INTEGRAL, param, listener);
    }

    /**
     * 我的 -- 意见反馈
     *
     * @param yijian   反馈意见
     * @param listener
     */
    public static void feedBack(String yijian, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("yijian", yijian);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.FEED_BACK, param, listener);
    }


    /**
     * 我的 -- 优惠券
     *
     * @param usercouponsstate 1-可使用 2-已使用 3-已过期
     * @param listener
     */
    public static void myCoupons(String usercouponsstate, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("usercouponsstate", usercouponsstate);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MY_COUPONS, param, listener);
    }

    /**
     * 我的订单
     *
     * @param orderstate 不同状态 1==未付款 2==待发货 3==待收货 4==待评价 5==已评价 6==订单售后处理 7==售后完成 8==订单完成
     * @param page
     * @param listener
     */
    public static void getOrderList(String orderstate, int page, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("orderstate", orderstate);
        param.put("page", page + "");
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MY_ORDER_LIST, param, listener);
    }


    /**
     * 我的收藏
     *
     * @param ctype    帖子（t） -- 商品（g）
     * @param listener
     */
    public static void getCollectData(String ctype, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("ctype", ctype);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.MY_COLLECT, param, listener);
    }

    /**
     * 我的订单 -- 发表评论
     *
     * @param goodsid       商品id
     * @param token
     * @param title         发表的内容
     * @param img           图片
     * @param attitudescore 服务态度
     * @param goodsscore    商品打分
     * @param orderid       订单id
     * @param listener
     */
    public static void getSendComment(String goodsid, String token, String title, String img, String attitudescore, String goodsscore, String orderid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("goodsid", goodsid);
        param.put("token", token);
        param.put("title", title);
        param.put("img", img);
        param.put("attitudescore", attitudescore);
        param.put("goodsscore", goodsscore);
        param.put("orderid", orderid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.SEND_COMMENTS, param, listener);
    }

    /**
     * 删除订单
     *
     * @param orderid
     * @param token
     * @param listener
     */
    public static void delOrder(String orderid, String token, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("orderid", orderid);
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.DEL_ORDER, param, listener);
    }

    /**
     * 4 == 确认收货 、 0 == 取消订单 、 8 == 订单完成
     *
     * @param token
     * @param orderid    订单id
     * @param orderstate 订单状态
     * @param listener
     */
    public static void stateChange(String token, String orderid, String orderstate, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("orderid", orderid);
        param.put("orderstate", orderstate);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.CONFIRM_RECEIPT, param, listener);
    }


    //--------------------------------------------发现-----------------------------------------------

    /**
     * 发现首页（公告和感谢榜单）
     *
     * @param listener
     */
    public static void getNoticeThankInfo(CommonHttpResponser listener) {
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.DISCOVERY_NOTICE_THANK_URL, null, listener);
    }

    /**
     * 发现首页（下面的榜单）
     *
     * @param listener
     */
    public static void getRankingTopInfo(CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.DISCOVERY_RANKING_URL, param, listener);
    }


    /**
     * 榜单详情
     *
     * @param expire   day日榜，week周榜，month月榜
     * @param listener
     */
    public static void getRankingDetail(String expire, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("expire", expire);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.RANKING_DETAIL_URL, param, listener);
    }

    //--------------------------------------------论坛-----------------------------------------------

    /**
     * 获取论坛列表（即亿友圈数据列表）
     *
     * @param page      页数（从1开始）
     * @param fourmtype （精选:high, 文字：title， 图片:img, 视频:video, 最新:lately）
     * @param listener
     */
    public static void getForumList(int page, String fourmtype, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("fourmtype", fourmtype);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.FORUM_LIST_URL, param, listener);
    }

    /**
     * 获取论坛详情
     *
     * @param page     页数（从1开始）
     * @param forumid  帖子id
     * @param listener
     */
    public static void getForumDetail(int page, String forumid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("forumid", forumid);
        param.put("token", token);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.FORUM_DETAIL_URL, param, listener);
    }

    /**
     * 帖子或帖子回复点赞（论坛）
     *
     * @param forumid  帖子id或者回复id
     * @param type     点赞的类别：true : 帖子，false: 回复
     * @param listener
     */
    public static void likeForum(String forumid, boolean type, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("forumid", forumid);
        if (type) {//帖子
            param.put("type", "t");
        } else {//回复
            param.put("type", "r");
        }
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.GET,
                NetworkConstants.FORUM_LIKE_URL, param, listener);
    }

    /**
     * 收藏或取消收藏帖子（论坛）
     *
     * @param forumid  帖子id
     * @param listener
     */
    public static void collectOrCancleForum(String forumid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("forumid", forumid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.FORUM_COLLECT_URL, param, listener);
    }

    /**
     * 亿友圈  --- 发布
     *
     * @param fourmtitle 帖子说明
     * @param fourmimg   图片
     * @param fourmvideo 视频
     * @param fourmress  地址
     * @param listener
     */
    public static void issueForum(String fourmtitle, String fourmimg, String fourmvideo, String fourmress, String videoimg, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("fourmtitle", fourmtitle);
        param.put("fourmimg", fourmimg);
        param.put("fourmvideo", fourmvideo);
        param.put("fourmress", fourmress);
        param.put("videoimg", videoimg);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.FORUM_ITEM_ADD_URL, param, listener);
    }

    /**
     * 亿友圈  --- 论坛回复
     *
     * @param forumid          帖子id
     * @param fourmreplaytitle 回复内容
     * @param pid              0:对帖子的回复 ，回复id: 对当前帖子的某条回复进行回复
     */
    public static void sendForumReply(String forumid, String fourmreplaytitle, String pid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("forumid", forumid);
        param.put("fourmreplaytitle", fourmreplaytitle);
        param.put("pid", pid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.FORUM_REPLY, param, listener);
    }


    /**
     * 关注接口（所有关注功能）
     *
     * @param focususerid
     * @param listener
     */
    public static void sendAttentionUser(String focususerid, CommonHttpResponser listener) {
        String token = PreferencesUtil.getString(PreferencesUtil.TOKEN, "");
        HashMap<String, String> param = new HashMap<>();
        param.put("token", token);
        param.put("focususerid", focususerid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.ATTENTION_URL, param, listener);
    }

    //---------------------------------------我的---------------------------------------------------

    /**
     * 求助模块个人中心的用户信息
     *
     * @param userid   用户id
     * @param listener
     */
    public static void getSeekUserInfo(String userid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("userid", userid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.PERSONAL_INFO, param, listener);
    }


    /**
     * 求助模块个人中心的求助
     *
     * @param page
     * @param userid
     * @param listener
     */
    public static void getSeekUserHelp(int page, String userid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("userid", userid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.GET,
                NetworkConstants.PERSONAL_SEEK_URL, param, listener);
    }

    /**
     * 求助模块个人中心的回复
     *
     * @param page
     * @param userid
     * @param listener
     */
    public static void getSeekUserReply(int page, String userid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("userid", userid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.GET,
                NetworkConstants.PERSONAL_REPLY_URL, param, listener);
    }

    /**
     * 求助模块个人中心的收藏
     *
     * @param page
     * @param userid
     * @param listener
     */
    public static void getSeekUserCollect(int page, String userid, CommonHttpResponser listener) {
        HashMap<String, String> param = new HashMap<>();
        param.put("page", String.valueOf(page));
        param.put("userid", userid);
        BaseNetworkManager.getInstance().sendRequest(BaseNetworkManager.HTTP_REQUEST_TYPE.POST,
                NetworkConstants.PERSONAL_COLLECT_URL, param, listener);
    }


    //--------------------------------------订单-----------------------------------------------------


}
